package com.czx.reflection.controller;

public class Test01 {
    public static void main(String[] args) throws ClassNotFoundException {
        //通过反射获取类的class对象
        Class aClass = Class.forName("com.czx.reflection.pojo.User");
        System.out.println(aClass);
        //一个类在内存中只有一个Class对象
        Class aClass2 = Class.forName("com.czx.reflection.pojo.User");
        Class aClass3 = Class.forName("com.czx.reflection.pojo.User");
        Class aClass4 = Class.forName("com.czx.reflection.pojo.User");
        //一个类被加载后，类的整个结构都会被封装在Class对象中,hashCode出来的的值是一样的
        System.out.println(aClass.hashCode());
        System.out.println(aClass2.hashCode());
        System.out.println(aClass3.hashCode());
        System.out.println(aClass4.hashCode());


    }
}
